package cn.ren.cloud.dto;

import cn.ren.cloud.utils.AssertUtil;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @author 23508
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserRegisterDto {
    /**
     * 电话
     */
    @NotEmpty(message = "手机号码不能为空!!!")
    @Pattern(regexp = AssertUtil.REGULAR_EXPRESSION_PHONE, message = "手机格式不正确!!!")
    private String mobile;
    /**
     * 密码
     */
    @NotEmpty(message = "密码不能为空!!!")
    @Size(min = 6, max = 12, message = "密码必须为6-12位!!!")
    private String password;
    /**
     * 图形验证码
     */
    @NotEmpty(message = "验证码不能为空!!!")
    @Size(min = 4, max = 6, message = "验证码必须为4或6位!!!")
    private String imageCode;
    /**
     * 短信验证码
     */
    @NotEmpty(message = "验证码不能为空!!!")
    @Size(min = 4, max = 6, message = "验证码必须为4或6位!!!")
    private String smsCode;
    /**
     * 注册途径
     */
    @NotNull(message = "注册渠道不能为空!!!")
    private Integer regChannel;

    @NotEmpty(message = "图形验证码异常，请稍后重试")
    private String imageCodeKey;
}
